<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<jsp:directive.page import="com.anhry.app.safety.util.OnlineUsers"/>
<jsp:directive.page import="com.anhry.app.safety.util.OnlineUser"/>
<jsp:directive.page import="com.anhry.app.safety.util.Util"/>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
    <base href="<%=basePath%>">   
    <link href="<%=basePath+Util.SKIN%>/css/style.css" type="text/css" rel="stylesheet">
    <link href="<%=basePath+Util.SKIN%>/css/right.css" type="text/css" rel="stylesheet">
    <title>在线用户查看</title>

  
  <body>
  <div  class="body-box">
  	<%
		java.util.Collection users = OnlineUsers.getInstance().getUsers();
		int onlines = 0;
		for (java.util.Iterator onUser = users.iterator(); onUser.hasNext();) {
			OnlineUser tu = (OnlineUser) onUser.next();
			if(tu.getName() != null && !"---".equals(tu.getName())){
				onlines++;
			}
		}
	%>
	 <div class="map">
	  <div class="map_con">
	   您当前的位置：在线用户查看
	  </div>
	
	 </div>
	 <div id="container">
	  <table border="0" cellpadding="0" cellspacing="0" class="mytable">
	   <thead>
	    <tr class="fixedHeaderTr">
	     <th>序号</th>
	     <th>登录名</th>
	     <th>管理员类型</th>
	     <th>所属单位</th>
	     <th>所属部门</th>
	     <th>登录时间</th>
	     <th>登录IP</th>
	    </tr>
	   </thead>
	   <tbody>
	    <%
				int k = 1;
				int m = 1;
				for (java.util.Iterator it = users.iterator(); it.hasNext();) {
				OnlineUser tu = (OnlineUser) it.next();
				if(tu.getName() != null && !"---".equals(tu.getName())){
			%>
	         <tr>
		       <td align="center">
		          <%=m%>	      
		       </td>
		       <td align="center"><%=tu.getName()%></td>
		       <td align="center">         
		          <%=tu.getUsertype()%>
		       </td>
		       <td align="center">         
		          <%=tu.getUserUnit()%>
		       </td>
		       <td align="center">         
		          <%=tu.getUserDept()%>
		       </td>
		       <td align="center">   
		         <%=tu.getLogintime()%>
		       </td>
		       <td align="center"><%=tu.getAddress()%></td>	      
	         </tr>
	         <%
				m++;
				}
				k++;
			  }
			%>
	   </tbody>
	  </table>
	 </div>
	</div>
  </body>
</html>
